import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from 'src/entities/user.entity';
import { Repository } from 'typeorm';
import { Login } from './dto/login.dto';

@Injectable()
export class LoginService {
  constructor(
    @InjectRepository(User)
    private usersRepository: Repository<User>,
  ) {}

  login(login: Login) {
    return this.usersRepository.findOne({
      where: { eMail: login.eMail, passWord: login.passWord },
    });
  }
}
